<?php

use yii\helpers\Html;
use yii\bootstrap\NavBar;
use kartik\widgets\SideNav;
use yii\bootstrap\Nav;

// OR if this package is installed separately, you can use
// use kartik\sidenav\SideNav;

/* @var $this \yii\web\View */
/* @var $content string */
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
    <head>
        <meta charset="<?= Yii::$app->charset ?>"/>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <?= Html::csrfMetaTags() ?>
        <title><?= Html::encode($this->title) ?></title>
        <?php $this->head() ?>
    </head>
    <body>
        <?php $this->beginBody() ?>
        <div class="wrap">
            <?php
            NavBar::begin([
                'brandLabel' => '工程管理专业教学资源数据库',
                'brandUrl' => Yii::$app->homeUrl,
                'options' => [
                    'class' => 'navbar-default navbar-fixed-top',
//            'style'=>'background:#00ffff',
                ],
            ]);
            echo Nav::widget([
                'options' => ['class' => 'navbar-nav navbar-right'],
                'items' => [
                    Yii::$app->user->isGuest ?
                            ['label' => '登录', 'url' => ['/site/login']] :
                            [
                        'label' => '退出登录 (' . Yii::$app->user->identity->username . ')',
                        'url' => ['/site/logout'],
                        'linkOptions' => ['data-method' => 'post']
                            ],
                ],
            ]);
            NavBar::end();
            ?>

            <div class="row">
                <div class="col-lg-2">
                    <br/>
                    <br/>
                    <br/>
                    <!--侧边菜单开始-->
                    <?php
                    $depts = \app\models\Dept::getDept();
                    echo SideNav::widget([
                        'type' => SideNav::TYPE_DEFAULT,
                        'heading' => ' ',
                        'items' => $depts,
                        'indItem' => '<i class="indicator glyphicon glyphicon-hand-right">&nbsp;</i>',
                        'indMenuOpen' => '<i class="indicator glyphicon glyphicon-chevron-down"></i>',
                        'indMenuClose' => '<i class="indicator glyphicon glyphicon-chevron-right"></i>',
                    ]);
                    ?>
                </div>
                <!--侧边菜单结束-->
                <div class="col-lg-10" >
                    <br/>
                    <br/>
                    <br/>
                    <?= $content ?>
                </div>
            </div>
        </div>


        <?php $this->endBody() ?>
    </body>
</html>
<?php $this->endPage() ?>
